{extend name="layout:default" /}

{block name="title"}评教管理{/block}

{block name="content"}
<link href="https://cdn.bootcss.com/layer/2.2/skin/layer.css" rel="stylesheet">

<style>
    .table-bordered {
        border: 1px solid #ddd;
    }
    .table-bordered>thead>tr>th, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>tbody>tr>td, .table-bordered>tfoot>tr>td{
        border: 1px solid #ddd;
    }
    .questions-list {
        padding: 20px 0 20px 20px;
     }
    .questions-list h2{
        font-size: 18px;
    }
    .questions-list ul, .questions-list li{
        list-style: none;
        font-size: 16px;
        line-height: 25px;
        padding: 0;
        margin: 0;
    }
    .questions-list ul {
        padding-left: 15px;
    }
    .questions-list p{
        color: #f00;
        margin-top: 30px;
        font-size: 18px;
    }
</style>
<div class="row">

    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title">{$e.title}评教列表-{$teacher.name}老师</h3>
            </div>
            <a href="{:url('/admin/evaluations/cadreList', ['eid'=>$Request.param.eid, 'teacher_id'=>$Request.param.teacher_id])}" class="btn btn-info">返回</a>
            <!-- /.box-header -->

            <div class="box-body table-responsive no-padding" style="padding: 10px">
                <table class="table table-bordered table-hover">
                    <tbody>
                        <tr>
                            <th width="50" style="width: 50px!important;">标题</th>
                            {for start="1" end="$q_count"}
                            <td width="50">{$i}</td>
                            {/for}
                        </tr>

                        <tr>
                            <td style="width: 50px !important;">选择</td>
                            {volist name="q" id="vo"}
                            <td>{$vo.answer}</td>
                            {/volist}
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="box-body questions-list">
                {volist name="q" id="vo"}
                <div class="row">
                    <div class="col-md-12">
                        <h2>1. 这是第一个评教题目（）</h2>
                        <ul>
                            {foreach name="$vo['questions']['cotent']" item="val"  key="k"}
                            <li>{$k}. {$val}</li>
                            {/foreach}
                        </ul>
                        <p>学生选择：{$vo.answer}</p>
                    </div>
                </div>
                {/volist}
            </div>
            <!-- /.box-body -->
        </div>
        <!-- /.box -->
    </div>
</div>

{/block}

{block name="js"}

<script src="https://cdn.bootcss.com/layer/2.2/layer.js"></script>
<script>

    function status(obj, id) {
        let s = +($(obj).prop("checked"));
        /*if (s == 2) {
            $('input:checkbox').prop('checked', false);
            $(obj).prop('checked', true);
        }*/
        // console.log(s, id);
        layer.confirm('您确定要改变？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.post('/admin/evaluations/status', {id:id, status: s}, function (data) {
                if (data.status == 200) {
                    layer.msg(data.message, {icon: 1})
                } else {
                    layer.msg(data.message, {icon: 2})
                }
                setTimeout(function () {
                    window.location.href = window.location;
                }, 200)
            });
        }, function(){
        });


    }
</script>
{/block}